home *** CD-ROM | disk | FTP | other *** search
/ The Atari Compendium / The Atari Compendium (Toad Computers) (1994).iso / files / prgtools / c / sozobon / sozlib15.zoo / sozdistr / include / xgemfast.h < prev   
Encoding:
C/C++ Source or Header  |  1995-04-03  |  27.6 KB  |  1,009 lines

  1. /* tab expansion/compression should be set to 4 */
  2. /**************************************************************************
  3.  *
  4.  * GEMFAST.H - Header file for common VDI and AES symbols.
  5.  
  6.  this is gemfast.h for xvdifast and xaesfast library
  7.  (SOZOBON eXtended version's GEM library)
  8.  It is based on the original gemfast.h, with little changes. So I kept
  9.  all other stuff in here. -jerry-
  10.  
  11.  *
  12.  *    This header file contains items compatible with both GEMDEFS and OBDEFS
  13.  *    from the Alcyon system.  Note that there are no 'extern' definitions
  14.  *    for the GEM functions, because they all return a signed int and work
  15.  *    fine as autodefined functions.
  16.  *
  17.  *    If you have a lot of source already coded for #include <gemdefs.h>,
  18.  *    you can create a dummy (empty) obdefs.h file, and code a new gemdefs.h
  19.  *    file which contains only #include <gemfast.h>.    YOU CAN NO LONGER USE
  20.  *    GEMDEFS AND OBDEFS WITH THE GEMFAST BINDINGS!  For the bindings libs
  21.  *    to work correctly, this header file must be used.
  22.  *
  23.  * Credits dept:
  24.  *     This file bears an amazing similarity to the original Alcyon GEMDEFS
  25.  *     and OBDEFS header files, which are copyrighted by Atari.  What can I
  26.  *     say?  Copyrighted or not, these are the names and values that every-
  27.  *     body uses, so OF COURSE the files look *awful* similar...
  28.  *
  29.  * Maintenance:
  30.  *    12/03/89 - v1.3
  31.  *               > Renamed a lot of functions, a name compatibility block was
  32.  *                 added at the end of this file to smooth the transition.
  33.  *               > Added NO_OBJECT, MU_MENTRY, MU_MEXIT to defines.
  34.  *               > Added XMULTI struct, even though it really belongs to v2.0
  35.  *    05/26/90 - v1.4
  36.  *               > Added RSHDR structure for imbedded resource support.
  37.  *               > Fixed all structures which defined pointers as 'long'...
  38.  *                 - ICONBLK ib_pmask, ib_pdata, ib_ptext
  39.  *                 - BITBLK  bi_pdata
  40.  *                 - USERBLK ub_code
  41.  *                 - PARMBLK pb_tree
  42.  *                 All of these structure elements now define the proper ptr.
  43.  *               > Added AESUTIL_A, AESFAST_A and VDIFAST_A symbols.    This
  44.  *                 allows specific indication of the presence or abscence of
  45.  *                 the bindings libraries, allowing a programmer to use the
  46.  *                 GEMFAST.H header without using the rest of GemFast.  This
  47.  *                 also allows conditional compilation code to be more
  48.  *                 specific:    it can now test for the presence of the header
  49.  *                 file (and handle the differences in the structure defs),
  50.  *                 and it can separately test for the presence of the libs,
  51.  *                 and the extended functions available therein.
  52.  *************************************************************************/
  53.  
  54. #ifndef GEMFAST_H                /* Prevent multiple inclusion */
  55.     /* xgemfast is based on:    */
  56. #define GEMFAST_H        1        /* Tell the world GEMFAST header is used */
  57. #define GEMF_VERSION    0x0141    /* Tell the world we are v1.41             */
  58. #define AESUTIL_A        1        /* Tell the world AESFAST utils  available */
  59.  
  60. #define _XGEMFAST        1        /* Tell the world XGEMfast is used */
  61. #define _XAESFAST_A        0x104    /* Tell the world XAESFAST lib is used */
  62. #define _XVDIFAST_A        0x105    /* Tell the world XVDIFAST lib is used */
  63. #define    _XAESFASTVERSION "1.04"
  64. #define    _XVDIFASTVERSION "1.05"
  65.  
  66.  
  67.     /* the aes variables are to find at end of file    */
  68.  
  69.     /* the VDI constants    */
  70.  
  71.                                 /* VDI inside fill styles - new names    */
  72. #if 0
  73.  
  74. #define VIS_HOLLOW    0            /* these names will be phased out soon... */
  75. #define VIS_SOLID    1
  76. #define VIS_PATTERN 2
  77. #define VIS_HATCH    3
  78. #define VIS_UDPTRN    4
  79.  
  80. #define VIP_HOLLOW    0            /* these names will be phased out soon... */
  81. #define VIP_1PTRN    1
  82. #define VIP_2PTRN    2
  83. #define VIP_3PTRN    3
  84. #define VIP_4PTRN    4
  85. #define VIP_5PTRN    5
  86. #define VIP_6PTRN    6
  87. #define VIP_SOLID    7
  88.  
  89. #endif
  90.                             /* polyline types    */
  91. enum {LT_SOLID =1, LT_LONGDASH, LT_DOTTED, LT_DASHDOT, LT_DASHED,
  92.         LT_DASHDOTDOT, LT_USERDEF};
  93.  
  94.                                 /* polyline end styles    */
  95. enum {LE_SQUARED, LE_ARROWED, LE_ROUNDED};
  96.  
  97.                                 /* default polymarker types    */
  98. enum {MT_DOT = 1, MT_PLUS, MT_ASTERIK, MT_SQUARE, MT_DCROSS, MT_DIAMOND};
  99.  
  100.                                 /* graphic test special effects    */
  101. #define TF_NORMAL        0x00
  102. #define TF_THICKENED    0x01
  103. #define TF_LIGTHENED    0x02
  104. #define TF_SLANTED        0x04
  105. #define TF_UNDERLINED    0x08
  106. #define TF_OUTLINED        0x10
  107. #define TF_SHADOWED        0x20
  108.                                 /* text alignment    */
  109. enum {TA_LEFT, TA_CENTER, TA_RIGHT};
  110. enum {TA_BASELINE, TA_HALF, TA_ASCENT, TA_BOTTOM, TA_DESCENT, TA_TOP};
  111.  
  112.                                 /* VDI interior fill index    */
  113. #define IS_HOLLOW    0
  114. #define IS_SOLID    1
  115. #define IS_PATTERN    2
  116. #define IS_HATCH    3
  117. #define IS_UDPTRN    4
  118.                             /* alternative names:    */
  119. enum {FIS_HOLLOW, FIS_SOLID, FIS_PATTERN, FIS_HATCH, FIS_USER};
  120.  
  121.                                 /* VDI inside fill style index    */
  122.     /* (scanning) patterns (together with FIS_PATTERN)    */
  123. #define IP_HOLLOW    0
  124. #define IP_1PTRN    1
  125. #define IP_2PTRN    2
  126. #define IP_3PTRN    3
  127. #define IP_4PTRN    4
  128. #define IP_5PTRN    5
  129. #define IP_6PTRN    6
  130. #define IP_7PTRN    7
  131. #define IP_SOLID    8
  132.     /* different patterns up to 24 follow    */
  133. #define IP_BRICK    9
  134. #define IP_LAST        24
  135.  
  136.     /* hatchings (together with FIS_HATCH)    */
  137. #define IP_1HATCH    1
  138. #define IP_2HATCH    2
  139. #define IP_3HATCH    3
  140. #define IP_4HATCH    4
  141. #define IP_5HATCH    5
  142. #define IP_6HATCH    6
  143. #define IP_7HATCH    7
  144. #define IP_8HATCH    8
  145. #define IP_9HATCH    9
  146. #define IP_10HATCH    10
  147. #define IP_11HATCH    11
  148. #define IP_12HATCH    12
  149.  
  150.  
  151.                                /* VDI normal graphics drawing modes */
  152. #define MD_REPLACE    1
  153. #define MD_TRANS    2
  154. #define MD_XOR        3
  155. #define MD_ERASE    4
  156.                                /* VDI bit blt rules */
  157. #define ALL_WHITE    0
  158. #define S_AND_D        1
  159. #define S_AND_NOTD    2
  160. #define S_ONLY        3
  161. #define NOTS_AND_D    4
  162. #define D_ONLY        5
  163. #define S_XOR_D        6
  164. #define S_OR_D        7
  165. #define NOT_SORD    8
  166. #define NOT_SXORD    9
  167. #define D_INVERT    10
  168. #define NOT_D        10
  169. #define S_OR_NOTD    11
  170. #define NOT_S        12
  171. #define NOTS_OR_D    13
  172. #define NOT_SANDD    14
  173. #define ALL_BLACK    15
  174.  
  175.                 /* VDI and AES colors    */
  176.  
  177. #define WHITE        0
  178. #define BLACK        1
  179. #define RED            2
  180. #define GREEN        3
  181. #define BLUE        4
  182. #define CYAN        5
  183. #define YELLOW        6
  184. #define MAGENTA        7
  185. #define LWHITE        8
  186. #define LBLACK        9
  187. #define LRED        10
  188. #define LGREEN        11
  189. #define LBLUE        12
  190. #define LCYAN        13
  191. #define LYELLOW        14
  192. #define LMAGENTA    15
  193.  
  194.  
  195.     /* the AES constants    */
  196.  
  197.                                     /* font types */
  198. #define IBM            3
  199. #define SMALL        5
  200.  
  201.                                     /* evnt_multi flags */
  202. #define MU_KEYBD    0x0001
  203. #define MU_BUTTON    0x0002
  204. #define MU_M1        0x0004
  205. #define MU_M2        0x0008
  206. #define MU_MESAG    0x0010
  207. #define MU_TIMER    0x0020
  208.                                     /* evnt_mouse flags */
  209. #define MU_MENTRY    0x0000
  210. #define MU_MEXIT    0x0001
  211.                                     /* keyboard states */
  212. #define K_RSHIFT    0x0001
  213. #define K_LSHIFT    0x0002
  214. #define K_SHIFT        0x0003
  215. #define K_CTRL        0x0004
  216. #define K_ALT        0x0008
  217.  
  218.                     /* event message values */
  219.     /* extensions for AES 4.0 inserted    */
  220.  
  221. #define MN_SELECTED 10
  222. #define WM_REDRAW    20
  223. #define WM_TOPPED    21
  224. #define WM_CLOSED    22
  225. #define WM_FULLED    23
  226. #define WM_ARROWED    24
  227. #define WM_HSLID    25
  228. #define WM_VSLID    26
  229. #define WM_SIZED    27
  230. #define WM_MOVED    28
  231. #define WM_NEWTOP    29
  232. #define WM_UNTOPPED        30    /* AES 3.3 */
  233. #define WM_ONTOP        31    /* AES 3.3 */
  234.  
  235. #define WM_ICONIFY        34    /* AES 4.1 */
  236. #define WM_UNICONIFY    35    /* AES 4.1 */
  237. #define WM_ALLICONIFY    36    /* AES 4.1 */
  238.  
  239. #define AC_OPEN            40
  240. #define AC_CLOSE        41
  241. #define AP_TERM            50    /* AES 4.0 */
  242. #define AP_TFAIL        51    /* AES 4.0 */
  243. #define AP_RESCHG        57    /* AES 4.0 */
  244. #define SHUT_COMPLETED    60    /* AES 4.0 */
  245. #define RESCH_COMPLETED    61    /* AES 4.0 */
  246. #define AP_DRAGDROP        63    /* AES 4.0 */
  247. #define SH_WDRAW        72    /* AES 4.0 */
  248. #define CH_EXIT            90    /* AES 4.0    this is the real value */
  249.  
  250. #define WM_M_BDROPPED    100    /* MagiC 2.00    */
  251. #define SM_M_RES1        101 /* MagiC ?? */
  252.     /* ...    */
  253. #define SM_M_RES9        109 /* MagiC ?? */
  254.  
  255. #define    WA_UPPAGE    0
  256. #define    WA_DNPAGE    1
  257. #define    WA_UPLINE    2
  258. #define    WA_DNLINE    3
  259. #define    WA_LFPAGE    4
  260. #define    WA_RTPAGE    5
  261. #define    WA_LFLINE    6
  262. #define    WA_RTLINE    7
  263.  
  264.                         /* form_dial opcodes */
  265. #define FMD_START    0
  266. #define FMD_GROW    1
  267. #define FMD_SHRINK    2
  268. #define FMD_FINISH    3
  269.                                     /* rsrc_gaddr structure types */
  270. #define ROOT        0                /* this name used by MWC */
  271. #define R_TREE        0
  272. #define R_OBJECT    1
  273. #define R_TEDINFO    2
  274. #define R_ICONBLK    3
  275. #define R_BITBLK    4
  276. #define R_STRING    5
  277. #define R_IMAGEDATA 6
  278. #define R_OBSPEC    7
  279. #define R_TEPTEXT    8
  280. #define R_TEPTMPLT    9
  281. #define R_TEPVALID    10
  282. #define R_IBPMASK    11
  283. #define R_IBPDATA    12
  284. #define R_IBPTEXT    13
  285. #define R_BIPDATA    14
  286. #define R_FRSTR        15
  287. #define R_FRIMG        16
  288.                                     /* Window Attributes */
  289. #define NAME        0x0001
  290. #define CLOSER        0x0002
  291. #define FULLER        0x0004
  292. #define MOVER        0x0008
  293. #define INFO        0x0010
  294. #define SIZER        0x0020
  295. #define UPARROW        0x0040
  296. #define DNARROW        0x0080
  297. #define VSLIDE        0x0100
  298. #define LFARROW        0x0200
  299. #define RTARROW        0x0400
  300. #define HSLIDE        0x0800
  301.  
  302. #define HOTCLOSEBOX    0x1000    /* MagiC ?? */
  303. #define BACKDROP    0x2000    /* MagiC 1.00    */
  304. #define SMALLER        0x4000
  305.  
  306.                                     /* wind_calc flags */
  307. #define WC_BORDER    0
  308. #define WC_WORK        1
  309.                                     /* wind_get/set flags */
  310. #define WF_KIND        1
  311. #define WF_NAME        2
  312. #define WF_INFO        3
  313. #define WF_WORKXYWH 4
  314. #define WF_CURRXYWH 5
  315. #define WF_PREVXYWH 6
  316. #define WF_FULLXYWH 7
  317. #define WF_HSLIDE    8
  318. #define WF_VSLIDE    9
  319. #define WF_TOP        10
  320. #define WF_FIRSTXYWH 11
  321. #define WF_NEXTXYWH 12
  322. #define WF_RESVD    13
  323. #define WF_NEWDESK    14
  324. #define WF_HSLSIZE    15
  325. #define WF_VSLSIZE    16
  326. #define WF_SCREEN    17
  327. #define WF_COLOR    18    /* AES 3.3 */
  328. #define WF_DCOLOR    19    /* AES 3.3 */
  329. #define WF_OWNER    20    /* AES 3.3 */
  330. #define WF_BEVENT    24    /* AES 3.31 */
  331. #define WF_BOTTOM    25    /* AES 3.31 */
  332. #define WF_ICONIFY            26    /* AES 4.1 */
  333. #define WF_UNICONIFY        27    /* AES 4.1 */
  334. #define WF_UNICONIFYXYWH    28    /* AES 4.1 */
  335.  
  336. #define WF_M_OWNER        101        /* MagiC 2.00    */
  337. #define WF_M_WINDLIST    102        /* MagiC 2.00    */
  338. #define WF_M_BACKDROP    100        /* MagiC 2.00    */
  339.  
  340. #ifndef DONT_USE_Winx
  341.     /* Winx 2.1 ??    */
  342. #define WF_RETURN        1
  343. #define WF_WINX            22360
  344. #define    WF_WINXCFG        22361
  345.  
  346. #define WM_BOTTOMED        33
  347. #endif
  348.  
  349.                                     /* wind_update flags */
  350. #define END_UPDATE    0
  351. #define BEG_UPDATE    1
  352. #define END_MCTRL    2
  353. #define BEG_MCTRL    3
  354. #define BEG_CHECK    0x100
  355.     /* or 'BEG...' with BEG_CHECK for non blocking wind_update()
  356.         and test for an error (0)    */
  357.  
  358.                                     /* graf_mouse mouse types*/
  359. #define ARROW        0
  360. #define TEXT_CRSR    1
  361. #define BUSY_BEE    2
  362. #define HOURGLASS    2                /* these names are used too */
  363. #define BUSYBEE        2
  364. #define BEE            2
  365. #define POINT_HAND    3
  366. #define FLAT_HAND    4
  367. #define THIN_CROSS    5
  368. #define THICK_CROSS 6
  369. #define OUTLN_CROSS 7
  370. #define USER_DEF    255
  371. #define M_OFF        256
  372. #define M_ON        257
  373.  
  374. #define M_SAVE            258        /* MultiTOS */
  375. #define M_RESTORE        259        /* MultiTOS */
  376. #define M_PREV            260        /* MultiTOS */
  377.  
  378.     /* menu_bar modes    */
  379. #define    MENU_HIDE    0
  380. #define    MENU_SHOW    1
  381. #define    MENU_INSTL    100    /* MagiC 1.0    */
  382.  
  383.     /* objc_sysvar() */
  384. #define OB_GETVAR    0
  385. #define OB_SETVAR    1
  386.     /* the objc_sysvar ob_swich values     */
  387. #define    LK3DIND        1
  388. #define LK3DACT        2
  389. #define INDBUTCOL    3
  390. #define ACTBUTCOL    4
  391. #define BACKGRCOL    5
  392. #define AD3DVALUE    6
  393.  
  394.  
  395.                 /* objects    */
  396.  
  397.             /* max depth of search or draw    */
  398. #define MAX_DEPTH    8
  399.  
  400.             /* object types */
  401.             /* value returned by objc_find(), et. al. */
  402. #define NO_OBJECT    -1
  403. #define G_BOX        20
  404. #define G_TEXT        21
  405. #define G_BOXTEXT    22
  406. #define G_IMAGE        23
  407. #define G_USERDEF    24
  408. #define G_PROGDEF    24
  409. #define G_IBOX        25
  410. #define G_BUTTON    26
  411. #define G_BOXCHAR    27
  412. #define G_STRING    28
  413. #define G_FTEXT        29
  414. #define G_FBOXTEXT    30
  415. #define G_ICON        31
  416. #define G_TITLE        32
  417. #define G_CICON     33        /* AES 3.3 */
  418.  
  419. #define G_SWBUTTON    34        /* MagiC 1.00 */
  420. #define G_POPUP        35        /* MagiC 1.00 */
  421.  
  422.                                 /* object flags */
  423. #define NONE        0x0000
  424. #define SELECTABLE    0x0001
  425. #define DEFAULT        0x0002
  426. #define EXIT        0x0004
  427. #define EDITABLE    0x0008
  428. #define RBUTTON        0x0010
  429. #define LASTOB        0x0020
  430. #define TOUCHEXIT    0x0040
  431. #define HIDETREE    0x0080
  432. #define INDIRECT    0x0100
  433. #define        FL3DMASK    0x0600    /* 3D objects AES 3.4    */
  434. #define        FL3DNONE    0x0000
  435. #define    FL3DIND        0x0200
  436. #define    FL3DBAK        0x0400
  437. #define    FL3DACT        0x0600    /* last of 3D object flags    */
  438.  
  439.                                 /* Object states */
  440. #define NORMAL        0x0000
  441. #define SELECTED    0x0001
  442. #define CROSSED        0x0002
  443. #define CHECKED        0x0004
  444. #define DISABLED    0x0008
  445. #define OUTLINED    0x0010
  446. #define SHADOWED    0x0020
  447. #define WHITEBAK    0x0040
  448. #define DRAW3D        0x0080
  449.  
  450.                                 /* editable text field definitions */
  451. #define EDSTART        0
  452. #define EDINIT        1
  453. #define EDCHAR        2
  454. #define EDEND        3
  455. #define    ED_CRSR        100     /* MagiC 1.00 */
  456. #define ED_DRAW        103     /* MagiC 2.00 */
  457.  
  458.                                 /* editable text justification */
  459. #define TE_LEFT        0
  460. #define TE_RIGHT    1
  461. #define TE_CNTR        2
  462.  
  463.                                 /* VDI Memory Form Definition Block */
  464. #if 0
  465. #ifndef FDADDR                    /* v1.3:  this typedef has been added to */
  466. typedef char *FDADDR;            /* help provide compatibility between     */
  467. #endif                            /* bindings systems.                     */
  468. #else
  469. typedef void *FDADDR;
  470. #endif
  471.  
  472. typedef struct fdbstr {
  473.     FDADDR        fd_addr;
  474.     short        fd_w;
  475.     short        fd_h;
  476.     short        fd_wdwidth;
  477.     short        fd_stand;
  478.     short        fd_nplanes;
  479.     short        fd_r1;
  480.     short        fd_r2;
  481.     short        fd_r3;
  482. } MFDB;
  483.  
  484. #define FDB    MFDB                    /* FDB for compatibily */
  485.  
  486.                                     /* Mouse Form Definition Block */
  487. typedef struct mfstr {
  488.     short mf_xhot;
  489.     short mf_yhot;
  490.     short mf_nplanes;
  491.     short mf_fg;
  492.     short mf_bg;
  493.     short mf_mask[16];
  494.     short mf_data[16];
  495. } MFORM ;
  496.  
  497. typedef struct grect {
  498.     short g_x;
  499.     short g_y;
  500.     short g_w;
  501.     short g_h;
  502. } GRECT;
  503.  
  504. typedef struct vrect {
  505.     short v_x1;
  506.     short v_y1;
  507.     short v_x2;
  508.     short v_y2;
  509. } VRECT;
  510.  
  511. typedef struct text_edinfo {
  512.     char    *te_ptext;                /* ptr to text                 */
  513.     char    *te_ptmplt;            /* ptr to template             */
  514.     char    *te_pvalid;            /* ptr to validation chrs.     */
  515.     short    te_font;                /* font                         */
  516.     short    te_junk1;                /* junk word                 */
  517.     short    te_just;                /* justification             */
  518.     short    te_color;                /* color information word     */
  519.     short    te_junk2;                /* junk word                 */
  520.     short    te_thickness;            /* border thickness             */
  521.     short    te_txtlen;                /* length of text string     */
  522.     short    te_tmplen;                /* length of template string */
  523. } TEDINFO;
  524.  
  525. typedef struct bftecolor {
  526. #if (SOZOBON  && __SOZOBONX__ < 0x223)
  527.     unsigned innercol:4;
  528.     unsigned fillpat:3;
  529.     unsigned textmode:1;
  530.     unsigned textcolor:4;
  531.     unsigned framecolor:4;
  532. #else
  533.     unsigned framecolor:4;
  534.     unsigned textcolor:4;
  535.     unsigned textmode:1;
  536.     unsigned fillpat:3;
  537.     unsigned innercol:4;
  538. #endif
  539. }bfTECOLOR;
  540.  
  541. typedef struct Xtext_edinfo {
  542.     char    *te_ptext;                /* ptr to text                 */
  543.     char    *te_ptmplt;                /* ptr to template             */
  544.     char    *te_pvalid;                /* ptr to validation chrs.     */
  545.     short    te_font;                /* font                         */
  546.     short    te_junk1;                /* junk word                 */
  547.     short    te_just;                /* justification             */
  548.     bfTECOLOR    te_color;            /* color information word     */
  549.     short    te_junk2;                /* junk word                 */
  550.     short    te_thickness;            /* border thickness             */
  551.     short    te_txtlen;                /* length of text string     */
  552.     short    te_tmplen;                /* length of template string */
  553. } XTEDINFO;
  554.  
  555. typedef struct icon_block {
  556.     short    *ib_pmask;
  557.     short    *ib_pdata;
  558.     char     *ib_ptext;
  559.     short    ib_char;
  560.     short    ib_xchar;
  561.     short    ib_ychar;
  562.     short    ib_xicon;
  563.     short    ib_yicon;
  564.     short    ib_wicon;
  565.     short    ib_hicon;
  566.     short    ib_xtext;
  567.     short    ib_ytext;
  568.     short    ib_wtext;
  569.     short    ib_htext;
  570. } ICONBLK;
  571.  
  572. typedef struct bfibchar {
  573. #if (SOZOBON  && __SOZOBONX__ < 0x223)
  574.     unsigned iconchar:8;
  575.     unsigned bgcolor:4;
  576.     unsigned iconcolor:4;
  577. #else
  578.     unsigned iconcolor:4;
  579.     unsigned bgcolor:4;
  580.     unsigned iconchar:8;
  581. #endif
  582. } bfIBCHAR;
  583.  
  584. typedef struct Xicon_block {
  585.     short        *ib_pmask;
  586.     short        *ib_pdata;
  587.     char        *ib_ptext;
  588.     bfIBCHAR     ib_char;
  589.     short        ib_xchar;
  590.     short        ib_ychar;
  591.     short        ib_xicon;
  592.     short        ib_yicon;
  593.     short        ib_wicon;
  594.     short        ib_hicon;
  595.     short        ib_xtext;
  596.     short        ib_ytext;
  597.     short        ib_wtext;
  598.     short        ib_htext;
  599. } XICONBLK;
  600.  
  601. typedef struct cicon_data {
  602.     short    num_planes;         /* number of planes in the following data */
  603.     short    *col_data;            /* pointer to color bitmap in standard form */
  604.     short    *col_mask;            /* pointer to single plane mask of col_data */
  605.     short    *sel_data;            /* pointer to color bitmap of selected icon */
  606.     short    *sel_mask;            /* pointer to single plane mask of selected icon */
  607.     struct    cicon_data *next_res;    /* pointer to next icon for a different resolution */
  608. } CICON;
  609.  
  610. typedef struct cicon_blk {
  611.     ICONBLK monoblk;    /* default monochrome icon */
  612.     CICON *mainlist;    /* list of color icons for different resolutions */
  613. } CICONBLK;
  614.  
  615.  
  616.  
  617. typedef struct bit_block {
  618.     short    *bi_pdata;                    /* ptr to bit forms data    */
  619.     short    bi_wb;                        /* width of form in bytes    */
  620.     short    bi_hl;                        /* height in lines            */
  621.     short    bi_x;                        /* source x in bit form        */
  622.     short    bi_y;                        /* source y in bit form        */
  623.     short    bi_color;                    /* fg color of blt            */
  624. } BITBLK;
  625.  
  626.  
  627. typedef struct user_blk {
  628.     short (*ub_code)(struct parm_blk *p_blk);
  629.     long ub_parm;
  630. } USERBLK;
  631.  
  632. #define appl_blk user_blk
  633. #define APPLBLK    USERBLK
  634.  
  635. typedef struct bfObspec {    /*  a bitfield for the ???BOX opsec    */
  636. #if (SOZOBON  && __SOZOBONX__ < 0x223)
  637. #pragma echo little endian bitfields
  638.     signed    framesize:8;
  639.     unsigned character:8;
  640.     unsigned innercol:4;
  641.     unsigned fillpat:3;
  642.     unsigned textmode:1;
  643.     unsigned textcol:4;
  644.     unsigned framecol:4;
  645. #else
  646. #pragma echo std bitfields
  647.     unsigned character:8;
  648.     signed     framesize:8;
  649.     unsigned framecol:4;
  650.     unsigned textcol:4;
  651.     unsigned textmode:1;
  652.     unsigned fillpat:3;
  653.     unsigned innercol:4;
  654. #endif
  655. } bfOBSPEC;
  656.  
  657. typedef union Obspec {
  658.     long    obspec;
  659.     bfOBSPEC bfobspec;
  660.     TEDINFO    *tedinfo;
  661.     ICONBLK    *iconblk;
  662.     CICONBLK *ciconblk;
  663.     BITBLK    *bitblk;
  664.     USERBLK    *userblk;
  665.     char    *free_string;
  666.     struct Swinfo *swinfo;        /* MagiC    */
  667.     struct Popinfo *popinfo;    /* MagiC    */
  668. } OBSPEC;
  669.  
  670. typedef struct object {
  671.     short            ob_next;        /* -> object's next sibling        */
  672.     short            ob_head;        /* -> head of object's children */
  673.     short            ob_tail;        /* -> tail of object's children */
  674.     unsigned short    ob_type;        /* type of object                */
  675.     unsigned short    ob_flags;        /* flags                        */
  676.     unsigned short    ob_state;        /* state                        */
  677. /*    long            ob_spec; */ /* replaced by following UNION -jerry-    */
  678.     OBSPEC            ob_spec;    /* whatever: ob_spec.obspec ...        */
  679.     short            ob_x;            /* upper left corner of object    */
  680.     short            ob_y;            /* upper left corner of object    */
  681.     short            ob_width;        /* width of obj                    */
  682.     short            ob_height;        /* height of obj                */
  683. } OBJECT;
  684.  
  685. typedef struct parm_blk {
  686.     OBJECT    *pb_tree;
  687.     short    pb_obj;
  688.     short    pb_prevstate;
  689.     short    pb_currstate;
  690.     short    pb_x, pb_y, pb_w, pb_h;
  691.     short    pb_xc, pb_yc, pb_wc, pb_hc;
  692.     long    pb_parm;
  693. } PARMBLK;
  694.  
  695.  
  696.  
  697.     /* MagiC objects:    */
  698. typedef struct Popinfo {
  699.     OBJECT    *tree;
  700.     short    obnum;
  701. } POPINFO;
  702.  
  703. typedef struct Swinfo {
  704.     char    *string;
  705.     short    num;
  706.     short    maxnum;
  707. } SWINFO;
  708.  
  709.  
  710.  
  711. /*-------------------------------------------------------------------------
  712.  * RSHDR structure...
  713.  *-----------------------------------------------------------------------*/
  714.  
  715. typedef struct rshdr {
  716.     short            rsh_vrsn;        /* Resource structure version # */
  717.     unsigned short    rsh_object;        /* Offset to first object        */
  718.     unsigned short    rsh_tedinfo;    /* Offset to first tedinfo        */
  719.     unsigned short    rsh_iconblk;    /* Offset to first iconblk        */
  720.     unsigned short    rsh_bitblk;        /* Offset to first bitblk        */
  721.     unsigned short    rsh_frstr;        /* Offset to free string index    */
  722.     unsigned short    rsh_string;        /* Offset to string data        */
  723.     unsigned short    rsh_imdata;        /* Offset to image data            */
  724.     unsigned short    rsh_frimg;        /* Offset to free image index    */
  725.     unsigned short    rsh_trindex;    /* Offset to tree index            */
  726.     unsigned short    rsh_nobs;        /* Number of objects            */
  727.     unsigned short    rsh_ntree;        /* Number object trees            */
  728.     unsigned short    rsh_nted;        /* Number of tedinfo structs    */
  729.     unsigned short    rsh_nib;        /* Number of iconblk structs    */
  730.     unsigned short    rsh_nbb;        /* Number of bitblk structs        */
  731.     unsigned short    rsh_nstring;    /* Number of free strings        */
  732.     unsigned short    rsh_nimages;    /* Number of free images        */
  733.     unsigned short    rsh_rssize;        /* total bytes in resource        */
  734. } RSHDR;
  735.  
  736. #define RSHDR_DEFINED 1 /* signal to other header files that RSHDR is done */
  737.  
  738.  
  739. typedef struct _menu
  740. {
  741.     OBJECT *mn_tree;        /*  - the object tree of the menu     */
  742.     short    mn_menu;         /* - the parent object of the menu items     */
  743.     short    mn_item;         /* - the starting menu item    */
  744.     short    mn_scroll;     /* - the scroll field status of the menu    */
  745.                     /* 0    - The menu will not scroll    */
  746.                     /* !0 - it will scroll if the number of menu
  747.                      *     items exceed the menu scroll height. The 
  748.                      * NOTE: If the scroll field status is !0, the menu
  749.                      *     items must consist entirely of G_STRINGS.
  750.                      */
  751.     short    mn_keystate;    /* - The CTRL, ALT, SHIFT Key state at the time the    */
  752. } MENU;
  753.  
  754. typedef struct _mn_set {
  755.     long    Display;     /* - the submenu display delay    */
  756.     long    Drag;         /* - the submenu drag delay    */
  757.     long    Delay;         /* - the single-click scroll delay    */
  758.     long    Speed;         /* - the continuous scroll delay    */
  759.     short    Height;     /* - the menu scroll height    */
  760. } MN_SET;
  761.  
  762.  
  763.     /* new shel_write calls (AES 4.00, MagiC)    */
  764.  
  765. /* MultiTOS (AES 4.00 and up) */
  766.  
  767. extern    short shel_write(short sh_wdoex, short sh_wisgr, short sh_wiscr,
  768.                     void *sh_wpcmd, char *sh_wptail);
  769.  
  770. /* sh_wdoex values:    */
  771. #define    SHW_LAUNCH    0x0000
  772. #define    SHW_RUNAPP    0x0001
  773. #define    SHW_RUNACC    0x0003
  774. #define    SHW_SHUTDN    0x0004
  775. #define    SHW_CHGRES    0x0005
  776. #define    SHW_BRCAST    0x0007
  777. #define    SHW_AESENV    0x0008
  778. #define    SHW_RECMSG    0x0009
  779. #define    SHW_SENDAES    0x000A
  780. /*
  781.  *  extended sh_wodex values, 'or' with one of the upper first 3 and
  782.  *  use a SH_WPCMD * for sh_wpcmd parameter
  783.  */
  784. #define    SHW_PSETL    0x0100
  785.     /* use psetlimit value from SH_WPCMD for the new process    */
  786. #define    SHW_PRENI    0x0200
  787.     /* use prenice value from SH_WPCMD for the new process    */
  788. #define    SHW_SCWD    0x0400    
  789.     /* chdir to cwd from SH_WPCMD for the new process    */
  790. #define    SHW_SENV    0x0800
  791.     /* use the environment strings from SH_WPCMD and not AES' ones    */
  792.  
  793. /* sh_wisgr    valid for (sh_wdoex & SHW_RUNAPP), i.e. 0x0001
  794.     0 : GEM application
  795.     1 : no GEM appication    */
  796.  
  797. typedef struct    Sh_wpcmd {
  798.     char    *cmd;            /* the command, needs no path or extension    */
  799.     long    psetlimit;
  800.     long    prenice;
  801.     char    *cwd;            /* the new process' cwd or NULL    */
  802.     char    *env;            /* the new process' environment or NULL    */
  803. } SH_WPCMD;
  804.  
  805.  
  806. /*     MagiC shel_write:
  807.     extern    short shel_write(short doex, short isgr, 
  808.                 short isover, char *pcmd, char *ptail);
  809.  
  810.     doex is always 1 ??
  811.     isgr is to set:
  812.         1 : for a GEM application
  813.         0 : for a no GEM appication
  814.  */
  815. /* important isover values */
  816. #define SHW_IMMED    0
  817. #define    SHW_CHAIN    1
  818. #define    SHW_PARALLEL    100
  819. #define    SHW_SINGLE        101
  820.  
  821.  
  822.  
  823.     /* special MagiC AES structures    */
  824.  
  825. typedef    struct Scanx {
  826.     char scancode;
  827.     char nclicks;
  828.     int  objnr;
  829. } SCANX;
  830.  
  831. typedef struct Xdo_inf {
  832.     SCANX *unsh;
  833.     SCANX *shift;
  834.     SCANX *ctrl;
  835.     SCANX *alt;
  836.     void  *resvd;
  837. } XDO_INF;
  838.  
  839.  
  840.     /* special xaesfast structures    */
  841.  
  842. typedef struct xmouse {
  843.     short retval;
  844.     short bclicks;
  845.     short mask;
  846.     short state;
  847.     short status;
  848.     short mousex;
  849.     short mousey;
  850.     short mouseb;
  851.     short keystate;
  852. } XMOUSE;
  853.  
  854. typedef struct xmulti {
  855.     short        msgbuf[8];    /* msg buffer    */
  856.     short        mflags,        /* click events    */
  857.             mbclicks,
  858.             mbmask,
  859.             mbstate,
  860.                 mm1flags;    /* mouse rect events    */
  861.     GRECT        mm1rect;
  862.     short        mm2flags;
  863.     GRECT        mm2rect;
  864.     short        mtlocount,    /* timer events    */
  865.             mthicount;
  866.     short        mwhich,        /* the return value, again    */
  867.             mmox,            /* the mouse state    */
  868.             mmoy,
  869.             mmobutton,
  870.             mmokstate,        /* the key state    */
  871.             mkreturn,        /* the key    */
  872.             mbreturn;        /* the mouse button    */
  873. } XMULTI;
  874.  
  875.  
  876.     /* now the AES variables    */
  877. extern    void *aespb[6];                /* The AES parameter Block    */
  878. extern    short aescontrol[5];        /* AES contrl[] array    */
  879. extern short global[15];            /* AES global[] array    */
  880.     /* in there is    */
  881. extern    short    gl_apversion;    /* the AES version number    */
  882. extern    short    gl_apcount;        /* max # of concurrent AES applications    */
  883. extern    short    gl_apid;        /* id of the current application    */
  884. extern    long    gl_apprivate;    /* anything application wants to store     */
  885. extern    OBJECT    **gl_apptree;    /* pointer to array of object tree ptrs    */
  886. extern    short    gl_ap1resv[];    /* global[7,8] pointer to head of rsc data    */
  887. extern    RSHDR    *gl_apprshdr;    /* pointer to head of rsc data    */
  888. extern    short    gl_ap2resv[6];    /* the rest of global array global[9-14]    */
  889. /* global[13, 14] not all AES versions:    */
  890. extern    short    _gl_chheight;    /* character heigth of AES font    */
  891. extern    short    _gl_smchheight;    /* character heigth of small AES font    */
  892.  
  893.     /* some function prototypes    */
  894.  
  895. extern    short vq_gdos();
  896. extern    unsigned long vq_vgdos();
  897. extern    void c_vdi(short *pb[5]);
  898.  
  899. extern short vqt_name(short handle, short index, char *name);
  900.             /* char name[33], name[32] is only set with NVDI     */
  901. extern short vqt_nvdi_name(short handle, short index, char *name, 
  902.         char *face, unsigned short *vecflag, unsigned short *font_format,
  903.         unsigned short *flags);
  904.             /* char name[17], char face[17] both [16] set to '\0'    */
  905. extern short vqt_x_name(short handle, short index, char *name,
  906.         unsigned short *vecflag, unsigned short *font_format, 
  907.         unsigned short *flags);
  908.             /* char name[33], name[32] is set to '\0'    */
  909.  
  910.  
  911. extern    void c_aes(unsigned long control, short *int_in, short *int_out,
  912.                         void *addr_in, void *addr_out);
  913. extern    void call_aes(unsigned long control);
  914. extern    void callaes(void);
  915.  
  916. /* special MagiC (including some GEM 2.x/3.x) AES functions    */
  917.  
  918. extern    short    form_xdial(short flag,
  919.             short littlx, short littly, short littlw, short littlh,
  920.             short bigx, short bigy, short bigw, short bigh,
  921.             void **flydial, void *dummy); /* dummy maybe a 'NULL' */
  922. extern    short    form_xdo( OBJECT *form, short start, short *lastcrsr,
  923.                         XDO_INF *tabs, void *flydial);
  924. extern    short    form_xerr(long errcode, char *errfile);
  925. extern    short    form_popup(OBJECT *tree, short x, short y);
  926. extern    short    scrp_clear();
  927. extern    void    shel_rdef(char *lpcmd, char *lpdir);
  928. extern    void    shel_xrdef(char *lpcmd, char *lpdir, char **buffer);
  929. extern    void    shel_wdef(char *lpcmd, char *lpdir);
  930. extern    short    menu_click(short val, short setit);
  931. extern    short    menu_unregister(short mid);
  932.  
  933. #if 0
  934. /* not in current version    */
  935. extern    short    appl_yield();
  936. #endif
  937.  
  938.  
  939.  
  940.  
  941. /**************************************************************************
  942.  *
  943.  * Name compatibility stuff.
  944.  *
  945.  *    05/26/90 - v1.4
  946.  *                Added mapping of find_exttype to obj_xtfind.
  947.  *    08/28/89 - v1.3
  948.  *                In v1.3, a big push has been made to make a consistant
  949.  *                naming standard for the AES utilities.    To avoid breaking
  950.  *                a lot of existing code, the following block will direct
  951.  *                the old names to the new routines.
  952.  *
  953.  *************************************************************************/
  954.  
  955. #define objclg_adjust            rc_gadjust
  956. #define objclv_adjust            rc_vadjust
  957.  
  958. #define objrb_which(a,b)        obj_rbfind((a),(b),SELECTED)
  959. #define obj_rbwhich(a,b)        obj_rbfind((a),(b),SELECTED)
  960. #define objxrb_which            obj_rbfind
  961.  
  962. #define objc_xywh                obj_xywh
  963.  
  964. #define find_exttype            obj_xtfind
  965.  
  966. #define objst_change            obj_stchange
  967. #define objfl_change            obj_flchange
  968.  
  969. #define    gl_aprshdr                gl_apprshdr
  970.  
  971.     /* AES related Functions  extensions to the standard GEM Lib    */
  972.  
  973. extern    void do_bell(short res, void* res2);    
  974.         /* beep without any console access!!    */
  975.  
  976. extern short evnx_multi(XMULTI *xm);
  977. extern void rsc_treefix(OBJECT *ptree);
  978. extern void rsc_gstrings(OBJECT *ptree, short object, char **ppstr, ...);
  979. extern void rsc_sstrings(OBJECT *ptree, short object, char *pstr, ...);
  980. extern long rsc_gspec(OBJECT *tree, short object);
  981. extern char *rsc_gpointer (OBJECT *tree, short object);
  982. extern void rsc_sspec(OBJECT *tree, short object, long obspec_value);
  983. extern void rsc_spointer(OBJECT *tree, short object, char *pointer);
  984. extern GRECT *rc_gadjust(GRECT *prect, short hadjust, short vadjust);
  985. extern VRECT *rc_vadjust(VRECT *prect, short hadjust, short vadjust);
  986. extern GRECT *rc_vtog(VRECT *pvrect, GRECT *pgrect);
  987. extern VRECT *rc_gtov(GRECT *pgrect, VRECT *pvrect);
  988. extern void rc_union(GRECT *sourcerect, GRECT *destrect);
  989. extern short rc_intersect(GRECT *sourcerect, GRECT *destrect);
  990. extern void rc_copy(void *sourcerect, void *destrect);
  991. extern short rc_equal(void *rect1, void *rect2);
  992. extern void objcl_calc (OBJECT *tree, short object, GRECT *grect, VRECT *vrect);
  993. extern void obj_flchange(OBJECT *ptree, short object, short newflags, short drawflag, ...);
  994. extern void obj_stchange(OBJECT *ptree, short object, short newstate, short drawflag, ...);
  995. extern void obj_offxywh(OBJECT *ptree, short object, GRECT *prect);
  996. extern void obj_xywh(OBJECT *ptree, short object, GRECT *prect);
  997. extern short obj_xtfind(OBJECT *ptree, short parent, short xtype);
  998. extern short obj_rbfind(OBJECT *ptree, short parent, short rbstate);
  999. extern short obj_rbselect(OBJECT *ptree, short selobj, short selstate);
  1000. extern short obj_parent(OBJECT *ptree, short object);
  1001. extern short frmx_center(OBJECT *ptree, GRECT *prect);
  1002. extern short winx_calc(short type, short kind, GRECT inrect, GRECT *outrect);
  1003. extern short winx_get(short whandle, short field, GRECT *outrect);
  1004.  
  1005.  
  1006. #endif
  1007.  
  1008. /*    end of xgemfast.h */
  1009.